<script type="text/javascript" src="${base}/scripts/cggl/nbcgddetail.js"></script>
<div id="nbcgd_tabs" class="easyui-tabs" detail="true" data-options="fit:true,border:false">
<input type="hidden" id="cgd_cgdh" value="${(cgd.cgdh)!}"/>
<input type="hidden" id="cgd_ewmtime" value="${(ewmtime)!}"/>

<div title="采购单">
    <table style="width: 99%;margin: 5px" class="tb tab-t t-bor">
        <input type="hidden" id="cgddetail_id" value="${(cgd.id)!}"/>
        <col width="110px"/>
        <col width=""/>
        <col width="110px"/>
        <col width=""/>
        <col width="110px"/>
        <col width=""/>
        <tr>
            <th>采购单号：</th>
            <td colspan="3">
            ${(cgd.cgdh)!}
            </td>
            <th>采购时间：</th>
            <td>${(cgd.cgsj?date)!}</td>
        </tr>
        <tr>
            <th>采购类型：</th>
            <td>
                内部采购
            </td>

            <th>供&nbsp;&nbsp;应&nbsp;&nbsp;商：</th>
            <td>
            ${(cgd.gys.jc)!}
            </td>
        </tr>
        <tr>
            <th>发货公司：</th>
            <td>
            ${(cgd.fhgs.qc)!}
            </td>
            <th>发货日期：</th>
            <td>
            ${(cgd.fhrq?date)!}
            </td>
            <th>到货日期：</th>
            <td>
            ${(cgd.jhdhrq?date)!}
            </td>
        </tr>
        <tr>
            <th>到货仓库：</th>
            <td>
            ${(cgd.dzck.mc)!}
            </td>
            <th>承运单位：</th>
            <td>
            ${(cgd.ysdw.qc)!}
            </td>
            <th>承运号：</th>
            <td>
            ${(cgd.cyh)!}
            </td>
        </tr>
        <tr>
        <#if cgd.cglx?? && cgd.cglx!="zddh" >
            <th>已入库：</th>
            <td>
                <#if cgd.yrk>是<#else>否</#if>
            </td>
            <th>入库时间：</th>
            <td>
            ${(cgd.rksj?date)!}
            </td>
            <th>入库人：</th>
            <td>
            ${(cgd.rkr.xm)!}
            </td>
        </#if>
        </tr>
        <tr>
            <th>采购公司：</th>
            <td>
            ${(cgd.cggs.qc)!}
            </td>
            <th>联系电话：</th>
            <td>
            ${(cgd.lxrdh)!}
            </td>
            <th>税率(%)：</th>
            <td>
            ${(cgd.sl)!}
            </td>
        </tr>
        <tr>
            <th>申报公司：</th>
            <td>
            ${(cgd.sbgs.jc)!}
            </td>
            <th>申报部门：</th>
            <td>
            ${(cgd.sbbm.qc)!}
            </td>
            <th>申&nbsp;报&nbsp;&nbsp;人：</th>
            <td>
            ${(cgd.sbr.xm)!}
            </td>
        </tr>
    <#if cgd.cglx??&& cgd.cglx=="zddh">
        <tr>
            <th>销售单号：</th>
            <td colspan="3">
            ${(cgd.xsd.xsdh)!}
            </td>
            <th>综合服务费(%)：</th>
            <td>${(cgd.cght.ll)!}</td>
        </tr>
        <tr>
            <th>销售合同：</th>
            <td>
            ${(cgd.xsd.xsht.htbm)!}
            </td>
            <th>客户</th>
            <td>${(cgd.xsd.kh.jc)!}</td>
            <th>提货人</th>
            <td>${(cgd.xsd.thr)!}</td>
        </tr>
    </#if>
        <tr>
            <th>状态：</th>
            <td>
            <#if cgd.zt == 'ybc'>已保存<#else><#if cgd.zt == 'ytj'>已提交<#else>已审批</#if></#if>
            </td>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td colspan="3">
            ${(cgd.bz)!}
            </td>
        </tr>
        <tr>
            <th>制&nbsp;单&nbsp;&nbsp;人：</th>
            <td>${(cgd.createUser.xm)!}</td>
            <th>制单时间：</th>
            <td>${(cgd.dateCreated?datetime)!}</td>
        </tr>
    </table>
</div>
<div title="采购明细">
    <table id="cgd_cgdmx_table" class="easyui-datagrid" url="${base}/cggl/nbcgd/nbcgd_cgmx?cgd.id=${(cgd.id)!}"
           rownumbers="true" fit="true" fitColumns="true" showFooter="true">
        <thead>
        <tr>
            <th data-options="field:'wzgg.code',width:50" rowspan="2">物资编码</th>
            <th data-options="field:'wzgg.name',width:30" rowspan="2">物资名称</th>
            <th data-options="field:'wzgg.ggxh',width:30" rowspan="2">规格型号</th>
            <th data-options="field:'wzgg.dw',width:20" rowspan="2">单位</th>
            <th data-options="field:'cd.z',width:20" rowspan="2">产地</th>
            <th colspan="2">发货</th>
            <th data-options="field:'jzfs.z',width:30" rowspan="2">记重方式</th>
            <th colspan="3">到货</th>
            <th data-options="field:'kh.khbm',width:30" rowspan="2">卡号</th>
            <th data-options="field:'hsj',width:40,formatter:formatJeForHtml" rowspan="2">含税单价(元)</th>
            <th data-options="field:'bhsj',width:40,formatter:formatJeForHtml" rowspan="2">不含税单价(元)</th>
        </tr>

        <tr>
            <th data-options="field:'js',width:20,formatter:formatSlForHtml">件数</th>
            <th data-options="field:'sbsl',width:30,formatter:formatSlForHtml">数量</th>
            <th data-options="field:'rkjs',width:20,formatter:formatSlForHtml">件数</th>
            <th data-options="field:'rkjz',width:20,formatter:formatSlForHtml">件重</th>
            <th data-options="field:'rksl',width:30,formatter:formatSlForHtml">数量</th>
        </tr>
        </thead>
    </table>
</div>
<div title="费用明细">
    <table id="cgd_cgdfy_table" class="easyui-datagrid" url="${base}/cggl/nbcgd/nbcgd_cgfy?cgd.id=${(cgd.id)!}"
           rownumbers="true" fit="true" fitColumns="true" showFooter="true">
        <thead>
        <tr>
            <th data-options="field:'sydw.qc',width:50">收益单位</th>
            <th data-options="field:'fylb.fykmjc',width:50">费用类别</th>
            <th data-options="field:'jfsl',width:30,formatter:formatSlForHtml">计费数量</th>
            <th data-options="field:'dj',width:30,formatter:formatJeForHtml">单价(元)</th>
            <th data-options="field:'je',width:30,formatter:formatJeForHtml">总金额(元)</th>
            <th data-options="field:'bz',width:50">备注</th>
        </tr>
        </thead>
    </table>
</div>
<div title="采购单文本">
    <div id="cgddetail-toolbar">
        <div class="PTools">
            <ul class="niu">
                <li><span class="xuan">选择打印机：</span>
                    <select class="ze" name="" style="">
                        <option>——默认——</option>
                    </select>
                </li>
                <li><a class="she" href="javascript:void(0);" onclick="nbcgd_detail_checkIsInstall()">检查插件</a></li>
                <li><a class="watch" href="javascript:void(0);" onclick="nbcgd_detail_printPreview()">打印</a></li>
            </ul>
        </div>
        <div id="nbcgddydetail_id">
            <object id="NBCGD_LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
                <embed id="NBCGD_LODOP_EM" type="application/x-print-lodop" width=0 height=0
                       pluginspage="install_lodop32.exe"></embed>
            </object>
            <div id="nbcgddetail_print_id" class="textcon">
                <table class="tb" style="width: 100%;font-size:13px;">
                    <colgroup>
                        <col width="10%;"/>
                        <col width="25%"/>
                        <col width="15%;"/>
                        <col width="20%"/>
                        <col width="12%;"/>
                        <col width="23%"/>
                    </colgroup>
                    <tbody>
                    <tr>
                        <th rowspan="2">收货单位:</th>
                        <td rowspan="2"><input class="input-tian" readonly="readonly"
                                               value="${(cgd.cggs.qc)!}"/></td>
                        <td rowspan="3" colspan="2" style="text-align: center;font-size: 18px">${(cgd.cggs.jc)!}
                            采购单(采购-收条)
                        </td>
                        <th>采购单编号:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="${(cgd.cgdh)!}"/></td>
                    </tr>
                    <tr>

                        <th>制单日期:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.dateCreated?date)!}</#if>"/></td>
                    </tr>
                    <tr>
                        <th>采购单位:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="${(cgd.gys.qc)!}"/></td>
                        <th>要求采购日期:</th>
                        <td><input class="input-tian" readonly="readonly"
                                   value="${(cgd.jhdhrq?date)!}"/></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div id="nbcgddetail_cgd_id" class="textcon"></div>
            <div id="nbcgddy_print_end" class="textcon">
                <table class="tb" style="width: 100%;font-size:13px;">
                    <colgroup>
                        <col width="10%;"/>
                        <col width="20%"/>
                        <col width="10%;"/>
                        <col width="20%"/>
                        <col width="10%;"/>
                        <col width="20%"/>
                    </colgroup>
                    <tbody>
                    <tr>
                        <th style="font-size: 12px;">制&nbsp;单&nbsp;人:</th>
                        <td>
                            <input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.createUser.xm)!}</#if>"/>

                        </td>
                        <th style="font-size: 12px;">收&nbsp;货&nbsp;人:</th>
                        <td>
                            <input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.rkr.xm)!}</#if>"/>
                        </td>
                        <th style="font-size: 12px;">验&nbsp;收&nbsp;组:</th>
                        <td>
                            <input class="input-tian" readonly="readonly"
                                   value="<#if cgd??>${(cgd.ysr.xm)!}</#if>"/>
                        </td>
                    </tr>
                    <tr>
                        <th style="font-size: 12px;">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</th>
                        <td colspan="7">
                            <input class="input-tian" readonly="readonly"
                                   value=""/>
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td colspan="7"><span
                                style="margin-left: 400px;">${(CurrentTime?string('yyyy-MM-dd HH:mm:ss'))!}</span></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</div>